//1.引入对应模块
import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from './../pages/Home/Home'
import Chat from './../pages/Chat/Chat'
import Me from './../pages/Me/Me'
import Recommend from './../pages/Recommend/Recommend'
import Search from './../pages/Search/Search'


//子路由
import Hot from './../pages/Home/Chindren/Hot/Hot.vue'
import Box from './../pages/Home/Chindren/Box'
import Dress from './../pages/Home/Chindren/Dress'
import Ele from './../pages/Home/Chindren/Ele'
import Food from './../pages/Home/Chindren/Food'
import General from './../pages/Home/Chindren/General'
import Man from './../pages/Home/Chindren/Man'
import Mbaby from './../pages/Home/Chindren/Mbaby'
import Shirt from './../pages/Home/Chindren/Shirt'



//2.声明使用
Vue.use(VueRouter)

//3.输出路由对象
export default new VueRouter({
  //3.1 配置一级路由
  routes: [
    {
      path: '/home',
      component: Home,
      children:[
        //热门板块
        { path: 'hot', component:Hot },
        { path: 'box', component:Box },
        { path: 'dress', component:Dress },
        { path: 'ele', component:Ele },
        { path: 'food', component:Food },
        { path: 'general', component:General },
        { path: 'man', component:Man },
        { path: 'mbaby', component:Mbaby },
        { path: 'shirt', component:Shirt },
        { path: '/home', redirect:'/home/hot' }
      ]
    },
    {
      path: '/recommend',
      component: Recommend
    },
    {
      path: '/search',
      component: Search
    },
    {
      path: '/me',
      component: Me
    },
    {
      path: '/chat',
      component: Chat
    },
    {
      path: '/',
      redirect: '/home'
    }
  ]
})